def foo():  # quit 退出

    max_ = None
    min_ = None

    while True:
        i = input(">>>>")
        nums = i.replace(',', ' ').split()
        if nums[0] == 'quit':
            break
        for x in nums:
            n = int(x)
            if max_ is None:
                max_ = n
                min_ = n
            if n > max_:
                max_ = n
            if n < min_:
                min_ = n

        print(max_, min_)



